#include <bits/stdc++.h>

using namespace std;

int main() {
	for(int i = 1; i <= 1000000; ++i) {
		std::cerr << i << "\n";
		system("./gen > good.in");
		system("./good");
		system("./bf < good.in > good.ans");
		assert(!system("diff -Z good.out good.ans"));
	}
}
